package com.neuronbit.businessflow.intellij;

import com.intellij.DynamicBundle;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.PropertyKey;

import java.util.function.Supplier;

/**
 * The type Bpm psi bundle.
 */
public final class BpmPsiBundle {
    /**
     * The constant BUNDLE.
     */
    public static final @NonNls String BUNDLE = "messages.BpmPsiBundle";
    private static final DynamicBundle INSTANCE = new DynamicBundle(BpmPsiBundle.class, BUNDLE);

    private BpmPsiBundle() {
    }

    /**
     * Message string.
     *
     * @param key    the key
     * @param params the params
     * @return the string
     */
    public static @NotNull @Nls String message(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
        return INSTANCE.getMessage(key, params);
    }

    /**
     * Partial message string.
     *
     * @param key              the key
     * @param unassignedParams the unassigned params
     * @param params           the params
     * @return the string
     */
    public static @Nls String partialMessage(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key,
                                             int unassignedParams,
                                             Object @NotNull ... params) {
        return INSTANCE.getPartialMessage(key, unassignedParams, params);
    }

    /**
     * Message pointer supplier.
     *
     * @param key    the key
     * @param params the params
     * @return the supplier
     */
    public static @NotNull Supplier<@Nls String> messagePointer(@NotNull @PropertyKey(resourceBundle = BUNDLE) String key, Object @NotNull ... params) {
        return INSTANCE.getLazyMessage(key, params);
    }
}
